package com.ehotting.edsta.circuitDesign.bean;

import com.ehotting.edsta.circuitDesign.Constants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DrivenBean {
    private Map<String, Map<String, String>> circuitTemplates;
    private Map<String,Object> msg = new HashMap<>();
    private List<Node> nodes = new ArrayList<>();
    private List<Edge> edges = new ArrayList<>();

    public Map<String, Map<String, String>> getCircuitTemplates() {
        return circuitTemplates;
    }

    public void setCircuitTemplates(Map<String, Map<String, String>> circuitTemplates) {
        this.circuitTemplates = circuitTemplates;
    }

    public Map<String, Object> getMsg() {
        return msg;
    }

    public void setMsg(Map<String, Object> msg) {
        this.msg = msg;
    }

    public List<Node> getNodes() {
        return nodes;
    }

    public void setNodes(List<Node> nodes) {
        this.nodes = nodes;
    }

    public List<Edge> getEdges() {
        return edges;
    }

    public void setEdges(List<Edge> edges) {
        this.edges = edges;
    }

    public static class Edge{
        private String sourceChipCode;

        private String targetChipCode;

        private Data data;

        public String getSourceChipCode() {
            return sourceChipCode;
        }

        public void setSourceChipCode(String sourceChipCode) {
            this.sourceChipCode = sourceChipCode;
        }

        public String getTargetChipCode() {
            return targetChipCode;
        }

        public void setTargetChipCode(String targetChipCode) {
            this.targetChipCode = targetChipCode;
        }

        public Data getData() {
            return data;
        }

        public void setData(Data data) {
            this.data = data;
        }
    }

    public static class Data{
        private ConfigData configData;

        public ConfigData getConfigData() {
            return configData;
        }

        public void setConfigData(ConfigData configData) {
            this.configData = configData;
        }
    }

    public static class ConfigData{

        private List<Pin> pinList = new ArrayList<>();

        private PeripheralData peripheralData;

        public List<Pin> getPinList() {
            return pinList;
        }

        public void setPinList(List<Pin> pinList) {
            this.pinList = pinList;
        }

        public PeripheralData getPeripheralData() {
            return peripheralData;
        }

        public void setPeripheralData(PeripheralData peripheralData) {
            this.peripheralData = peripheralData;
        }
    }

    public static class PeripheralData{
        private String slaveChipPeripheralTypeName;
        private String slaveChipPeripheralName = "";
        private String masterChipPeripheralName;

        public String getSlaveChipPeripheralTypeName() {
            return slaveChipPeripheralTypeName;
        }

        public void setSlaveChipPeripheralTypeName(String slaveChipPeripheralTypeName) {
            this.slaveChipPeripheralTypeName = slaveChipPeripheralTypeName;
        }

        public String getSlaveChipPeripheralName() {
            return slaveChipPeripheralName;
        }

        public void setSlaveChipPeripheralName(String slaveChipPeripheralName) {
            this.slaveChipPeripheralName = slaveChipPeripheralName;
        }

        public String getMasterChipPeripheralName() {
            return masterChipPeripheralName;
        }

        public void setMasterChipPeripheralName(String masterChipPeripheralName) {
            this.masterChipPeripheralName = masterChipPeripheralName;
        }
    }

    public static class Interface{
        private String slaveChipInterfaceTypeName;

        private String slaveChipInterfaceName;

        private String masterChipResourceName;

        private List<Pin> pinList = new ArrayList<>();

        public String getSlaveChipInterfaceTypeName() {
            return slaveChipInterfaceTypeName;
        }

        public void setSlaveChipInterfaceTypeName(String slaveChipInterfaceTypeName) {
            this.slaveChipInterfaceTypeName = slaveChipInterfaceTypeName;
        }

        public String getMasterChipResourceName() {
            return masterChipResourceName;
        }

        public void setMasterChipResourceName(String masterChipResourceName) {
            this.masterChipResourceName = masterChipResourceName;
        }

        public List<Pin> getPinList() {
            return pinList;
        }

        public void setPinList(List<Pin> pinList) {
            this.pinList = pinList;
        }

        public String getSlaveChipInterfaceName() {
            return slaveChipInterfaceName;
        }

        public void setSlaveChipInterfaceName(String slaveChipInterfaceName) {
            this.slaveChipInterfaceName = slaveChipInterfaceName;
        }
    }

    public static class Pin{
        private String slaveChipInterfaceTypeName = "GPIO";
        private String slaveChipInterfaceName;
        private String masterChipResourceName;

        public String getSlaveChipInterfaceTypeName() {
            return slaveChipInterfaceTypeName;
        }

        public void setSlaveChipInterfaceTypeName(String slaveChipInterfaceTypeName) {
            this.slaveChipInterfaceTypeName = slaveChipInterfaceTypeName;
        }

        public String getSlaveChipInterfaceName() {
            return slaveChipInterfaceName;
        }

        public void setSlaveChipInterfaceName(String slaveChipInterfaceName) {
            this.slaveChipInterfaceName = slaveChipInterfaceName;
        }

        public String getMasterChipResourceName() {
            return masterChipResourceName;
        }

        public void setMasterChipResourceName(String masterChipResourceName) {
            this.masterChipResourceName = masterChipResourceName;
        }
    }

     public static class Node{
        private String chipCode;

        private String model;

        private String manufacturer = "";

         public String getManufacturer() {
             return manufacturer;
         }

         public void setManufacturer(String manufacturer) {
             this.manufacturer = manufacturer;
         }

         public String getChipCode() {
            return chipCode;
        }

        public void setChipCode(String chipCode) {
            this.chipCode = chipCode;
        }

        public String getModel() {
            return model;
        }

        public void setModel(String model) {
            this.model = model;
        }
    }
}

